package top.z.orm.core.osql.service;

import top.z.orm.core.osql.Condition;
import top.z.orm.core.osql.Suid;

import java.util.List;

/**
 * 默认抽象通用面向对象SQL服务实现类
 */
public abstract class ObjSQLAbstractServiceImpl implements ObjSQLService {

    public abstract Suid getSuid();

    @Override
    public <T> Integer insert(T entity) {
        return getSuid().insert(entity);
    }

    @Override
    public <T> List<T> select(T entity) {
        return getSuid().select(entity);
    }

    @Override
    public <T> Integer delete(T entity) {
        return getSuid().delete(entity);
    }

    @Override
    public <T> Integer update(T entity) {
        return getSuid().update(entity);
    }

    @Override
    public <T> List<T> select(T entity, Condition condition) {
        return getSuid().select(entity, condition);
    }

    @Override
    public <T> Integer delete(T entity, Condition condition) {
        return getSuid().delete(entity, condition);
    }

    @Override
    public Suid setDynamicParameter(String para, String value) {
        return getSuid().setDynamicParameter(para, value);
    }

    @Override
    public void beginSameConnection() {
        getSuid().beginSameConnection();
    }

    @Override
    public void endSameConnection() {
        getSuid().endSameConnection();
    }
}